import React,{useState,useEffect} from "react";
import {$getImg} from "../../api/getImgapi";
import {Button} from "antd";
import {UserDeleteOutlined } from '@ant-design/icons';


export default function User1({user}){
    //为了获取的图片数据
    const [imgdata, setImgData] = useState(null);
    const [size, setSize] = useState('large');
    useEffect(()=>{
        //获取个人头像
        const response=$getImg({ studentId: user.studentId.toString() });
        response.then((result) => {
            if(result.code===1){
                const { data } = result;
                setImgData(data);
            }
        });
    },[])
    return(
        <div style={{display:'flex',marginBottom:'40px',marginTop:'40px',justifyContent:'space-between',height:'150px'}}>
            <div style={{display:'flex'}}>
                <div style={{marginLeft:'20px'}}>
                    <img src={`data:image/jpeg;base64,${imgdata}`} alt="获取图片失败"
                         style={{width: '70px', height: '70px'}}/>
                </div>

                <div style={{fontWeight:'bold',fontSize:'20px',marginTop:'20px',marginLeft:'20px'}}>{user.nickname}</div>
                <div style={{marginLeft:'70px',marginTop:'18px',fontSize:'20px',color:'rgb(210, 210, 210)'}}>{user.briefIntroduction}</div>
            </div>

        </div>
    )
}